﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using SCMS.Model;

namespace SCMS.UI.Models
{
    public class Project
    {
        public SCMS.Model.Project EntityProject { get; set; }

        public string Id { get; set; }

        [Required(ErrorMessage = "Please enter Project Number")]
        public string ProjectNumber { get; set; }

        [Required(ErrorMessage="Please enter Project Name")]
        [StringLength(255, MinimumLength=3, ErrorMessage="Project name must be at least 3 characters long.")]
        public string ProjectName
        {
            get { return EntityProject.Name; }
            set { EntityProject.Name = value; }
        }

        [Required(ErrorMessage="Please specify Donor")]
        public string DonorId { get; set; }

        [Required(ErrorMessage = "Please specify currency")]
        public string CurrencyId { get; set; }

        public System.Web.Mvc.SelectList Donors { get; set; }

        public System.Web.Mvc.SelectList Currencies { get; set; }

        [DataType(DataType.Date)]
        [Required(ErrorMessage="Please specify project start date")]
        public DateTime StartDate { get; set; }

        [DataType(DataType.Date)]
        [Required(ErrorMessage = "Please specify project end date")]
        public DateTime EndDate { get; set; }

        [Required(ErrorMessage = "Please specify Donor")]
        public Guid ProjectManagerId { get; set; }

        public SelectList StaffList { get; set; }
    }

    public class DocPreparer
    {
        public DocumentPreparer EntityDocPreparer { get; set; }

        [Required]
        public Guid PreparerId
        {
            get { return EntityDocPreparer.PreparerId; }
            set { EntityDocPreparer.PreparerId = value; }
        }

        public SelectList StaffList { get; set; }
    }
}